package com.wang.store.service;

import com.wang.store.entity.Address;
import com.wang.store.entity.User;
import com.wang.store.service.impl.AddressServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class AddressService {

    @Autowired
    private IAddressService addressService;

    @Test
    public  void addNewAddress(){
        Integer uid = 18;
        String username = "管理员";
        Address address = new Address();
        address.setName("张三");
        address.setPhone("17858805555");
        address.setAddress("雁塔区小寨华旗");
        addressService.addNewAddress(address,uid,username);
        System.out.println("Ok");
    }
    @Test
    public  void setDefault(){
            addressService.setDefault(13,10,"强子");
    }
    @Test
    public  void delete(){
        addressService.delete(15,10,"强子");
    }


}
